home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / buildy1a / hsplit.cls < prev    next >
Text File  |  1999-09-07  |  3KB  |  128 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "HSplit"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = True
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = True
  10. 'This Object module will be compiled into part of the
  11. 'binary file that our test project will use to set
  12. 'properties for the objects on the form.
  13. '
  14. 'This Object module will control the Horizontal Splitter
  15. Option Explicit
  16.  
  17. 'local veariable(s) to hold property value(s)
  18. Private mHostPane As Object ' local copy
  19. Private mTopPane As Object ' local copy
  20. Private mBottomPane As Object ' local copy
  21. Private mSplitBar As Object ' local copy
  22. Private mSplitOn As Boolean ' local copy
  23.  
  24. Public Property Get HostPane() As Object
  25.   '
  26.   Set HostPane = mHostPane
  27.   '
  28. End Property
  29.  
  30. Public Property Set HostPane(ByVal vData As Object)
  31.   '
  32.   Set mHostPane = vData
  33.   '
  34. End Property
  35.  
  36. Public Property Set SplitBar(ByVal vData As Object)
  37.   '
  38.   Set mSplitBar = vData
  39.   '
  40. End Property
  41.  
  42. Public Property Get SplitBar() As Object
  43.   '
  44.   Set SplitBar = mSplitBar
  45.   '
  46. End Property
  47.  
  48. Public Property Get SplitOn() As Boolean
  49.   '
  50.     SplitOn = mSplitOn
  51.   '
  52. End Property
  53.  
  54. Public Property Let SplitOn(ByVal vData As Boolean)
  55.   '
  56.   mSplitOn = vData
  57.   '
  58. End Property
  59.  
  60. Public Sub SetPointer(pType As Integer)
  61.   '
  62.     mHostPane.MousePointer = pType
  63.   '
  64. End Sub
  65.  
  66. Public Sub ResizePanes(Optional Twips As Single)
  67.   ' everything else so far just told the exe where to
  68.   ' place the objects, here is where the magic happens!
  69.   On Error GoTo localerr
  70.   '
  71.   If IsMissing(Twips) Then
  72.       Twips = 0
  73.   End If
  74.   ' This will set the properties for the Horizontal
  75.   ' splitter when it is moved
  76.   With mSplitBar
  77.     .Left = 0
  78.     .Top = .Top + Twips
  79.     .Height = 30
  80.     .Width = mHostPane.ScaleWidth
  81.   End With
  82.   ' This will resize the top pane
  83.   With mTopPane
  84.     .Left = 0
  85.     .Top = 0
  86.     .Width = mHostPane.ScaleWidth
  87.     .Height = mSplitBar.Top
  88.   End With
  89.   ' This will resize the bottom pane
  90.   With mBottomPane
  91.     .Left = 0
  92.     .Top = mSplitBar.Top + mSplitBar.Height
  93.     .Width = mHostPane.ScaleWidth
  94.     .Height = mHostPane.ScaleHeight - _
  95.       (mTopPane.Height + mSplitBar.Height)
  96.  End With
  97.  '
  98.  Exit Sub
  99.  
  100. localerr:
  101.    ' ignore any errors.
  102. End Sub
  103.  
  104. Public Property Set BottomPane(ByVal vData As Object)
  105.   '
  106.   Set mBottomPane = vData
  107.   '
  108. End Property
  109.  
  110. Public Property Get BottomPane() As Object
  111.   '
  112.   Set BottomPane = mBottomPane
  113.   '
  114. End Property
  115.  
  116. Public Property Set TopPane(ByVal vData As Object)
  117.   '
  118.   Set mTopPane = vData
  119.   '
  120. End Property
  121.  
  122. Public Property Get TopPane() As Object
  123.   '
  124.   Set TopPane = mTopPane
  125.   '
  126. End Property
  127.  
  128.